﻿#if UNITY_EDITOR
using System;
using System.Collections.Generic;
/// <summary>
/// 模板解析器
/// </summary>
public abstract class AbsESF_TempleteParser
{
    #region Resolver 解析代码模板
    /// <summary>
    /// 解析代码模板
    /// </summary>
    /// <param name="_codeTemplete">代码模板</param>
    /// <returns>代码结果</returns>
    public List<T> Resolver<T>(string _codeTemplete)
        where T: AbsESF_Result
    {
        return OnResolver<T>(_codeTemplete);
    }

    /// <summary>
    /// 解析代码模板
    /// </summary>
    /// <param name="_codeTemplete">代码模板</param>
    /// <returns>代码</returns>
    protected virtual List<T> OnResolver<T>(string _codeTemplete)
        where T: AbsESF_Result
    {
        return new List<T>() { (T)Activator.CreateInstance(typeof(T), _codeTemplete, enESF_CodeResult.CodeBlock) };
    }
    #endregion
}
#endif
